layui.use(['upload', 'element'], function(){
              var upload = layui.upload;
              var element = layui.element;
              var uploadInst = upload.render({
                elem: '#upload', // 绑定元素
                url: 'callup.php', // 上传接口
                before: function(obj){
                  // 显示进度条
                  $('#progressBar').show();
                },
                progress: function(n, elem){
                  // 更新进度条
                  element.progress('progressBar', n + '%');
                },
                done: function(res){
                  console.log(res);
                  $('#progressBar').hide();
                },
                error: function(){
                  // 请求异常回调
                  // 隐藏进度条
                  $('#progressBar').hide();
                }
              });
            });